export default {
  computed: {
    physics() {
      return this.$store.state.phyResourcesBar
    }

  },

  data() {
    return {
      network: [{
          type: "公网IP",
          value: 22
        },
        {
          type: "私网IP",
          value: 243
        }, {
          type: "出口带宽",
          value: 200
        },
        {
          type: "总端口",
          value: 224
        }, {
          type: "其他",
          value: 800
        },
      ],
      carousel: [{
          type: "虚拟机",
          value: .8
        },
        {
          type: "业务",
          value: 0.2
        },
        {
          type: "客户",
          value: 0.24
        },
      ],
      carouselLine: [
        [{
            month: "1",
            city: "虚拟机",
            temperature: .7
          },
          {
            month: "1",
            city: "CPU",
            temperature: .39
          },
          {
            month: "1",
            city: "内存",
            temperature: .17
          },
          {
            month: "1",
            city: "存储",
            temperature: .9
          }, {
            month: "2",
            city: "虚拟机",
            temperature: .57
          },
          {
            month: "2",
            city: "CPU",
            temperature: .4
          },
          {
            month: "2",
            city: "内存",
            temperature: .7
          },
          {
            month: "2",
            city: "存储",
            temperature: .59
          }, {
            month: "3",
            city: "虚拟机",
            temperature: .15
          },
          {
            month: "3",
            city: "CPU",
            temperature: .42
          },
          {
            month: "3",
            city: "内存",
            temperature: .27
          },
          {
            month: "3",
            city: "存储",
            temperature: .49
          },

        ],
        [{
            month: "1",
            city: "虚拟机",
            temperature: .7
          },
          {
            month: "1",
            city: "CPU",
            temperature: .39
          },
          {
            month: "1",
            city: "内存",
            temperature: .17
          },
          {
            month: "1",
            city: "存储",
            temperature: .9
          }, {
            month: "2",
            city: "虚拟机",
            temperature: .57
          },
          {
            month: "2",
            city: "CPU",
            temperature: .4
          },
          {
            month: "2",
            city: "内存",
            temperature: .7
          },
          {
            month: "2",
            city: "存储",
            temperature: .59
          }, {
            month: "3",
            city: "虚拟机",
            temperature: .15
          },
          {
            month: "3",
            city: "CPU",
            temperature: .42
          },
          {
            month: "3",
            city: "内存",
            temperature: .27
          },
          {
            month: "3",
            city: "存储",
            temperature: .49
          },

        ],
      ],

      isHome: true,



    }
  },
  methods: {
    async changePool(e) {
      let mapData = this.$store.state.mapData;
      let data
      if (e == '600da240e4b0fbef100d80ef') {
        data = await this.$store.dispatch('vmware')
        this.$store.dispatch('setCount', [data])
        this.isHome = false
        this.$refs.mid.showFlyLayer(false)
        let map = [mapData[1]]
        this.$refs.mid.setDotPoint(map)


      } else if (e == '6011b81de4b05cbf63964f76') {
        data = await this.$store.dispatch('hWStack')
        this.$store.dispatch('setCount', [data])
        this.isHome = false
        let map = [mapData[2]]
        this.$refs.mid.setDotPoint(map)

        this.$refs.mid.showFlyLayer(false)

      }else if (e == '60b7ad77d5de5f999da19331') {
        data = await this.$store.dispatch('zjBusinessQueryList')
        console.log(111,this.$store.state.zjBusinessCount)
        let count= {
          vmCpuCount:this.$store.state.zjBusinessCount.distributioncpu,
          vmDiskSize:this.$store.state.zjBusinessCount.distributionstorage,
          vmCount:this.$store.state.zjBusinessCount.vmcount,
          vmMemSize:this.$store.state.zjBusinessCount.distributionmem,
        }
        this.$store.commit('setCountAll',count)
        // this.$store.dispatch('setCount', [data])
        this.isHome = false
        // let map = [mapData[2]]
        // this.$refs.mid.setDotPoint(map)

        // this.$refs.mid.showFlyLayer(false)

      } else {
        const data1 = await this.$store.dispatch('vmware')
        const data2 = await this.$store.dispatch('hWStack')
        this.$store.dispatch('setCount', [data1, data2])
        this.isHome = true
        this.$refs.mid.showFlyLayer(true)
        this.$refs.mid.setDotPoint(mapData)

      }

    },



    async getAllData() {
      const data1 = await this.$store.dispatch('vmware')
      const data2 = await this.$store.dispatch('hWStack')
      const vdc = await this.$store.dispatch('vdcCount')
      const project = await this.$store.dispatch('projectCount')
      this.$store.commit('setVdcAndProject', {
        vdc: vdc.count,
        project: project.count
      })

      this.$store.dispatch('setCount', [data1, data2])
    }

  },

};